using System;
using TerritoryGame.Domain.Entities;

namespace TerritoryGame.Domain.Entities.App
{
    public class PlayerStats : EntityBase
    {
        public Guid PlayerId { get; set; } // Foreign key to Player
        public string Username { get; set; }
        public int TotalGamesPlayed { get; set; }
        public int TotalGamesWon { get; set; }
        public int TotalAreaPainted { get; set; }
        public double AverageAreaPerGame { get; set; }
        public TimeSpan TotalPlayTime { get; set; }
        public DateTime FirstGameDate { get; set; }
        public DateTime LastGameDate { get; set; }
        public int CurrentStreak { get; set; }
        public int BestStreak { get; set; }
        
        public double WinRate => TotalGamesPlayed > 0 ? (double)TotalGamesWon / TotalGamesPlayed * 100 : 0;
        
        // Navigation property
        public Player Player { get; set; } = null!;
    }
}
